//index.js
//获取应用实例
const app = getApp() //导出数据
var newdata=require("../data/newsdata.js")

Page({
  data: {
    indicator:"true",
    indicators: "true",
    indcolor: "#109D59",
    autoplays: "true",
    intervals: "4000",
    circulars: "true",
    useDate:""
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {//监听页面加载
    this.setData({      //设置循环数据 可以重绘数据
      useDate: newdata.initDatatrue
    })
  },
  getUserInfo: function(e) {
    console.log(e)
    app.globalData.userInfo = e.detail.userInfo
    this.setData({
      userInfo: e.detail.userInfo,
      hasUserInfo: true
    })
  },
  gontab(e){//页面跳转
    console.log(e.currentTarget.dataset.nesid)
     wx.navigateTo({
       url: '../news/new-detali/new-detali?newid='+e.currentTarget.dataset.nesid
     })
    //tab跳转必须用此函数
    // wx.switchTab({
    //   url: '../news/new-detali/new-detali?newid=' + e.currentTarget.dataset.nesid
    // })
  }
})

